﻿using System;
using System.Collections.Generic;

namespace NewsMine.Logging
{
    public interface INewsMineLogger
    {
        /// <summary>
        /// Writes the diagnostic message at the Debug level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void Debug(string message, IDictionary<object, object> properties = null);
        
        /// <summary>
        /// Writes the diagnostic message and exception at the Debug level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="ex">Exception to Log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void DebugException(string message, Exception ex, IDictionary<object, object> properties = null);
        
        /// <summary>
        /// Writes the diagnostic message at the Error level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void Error(string message, IDictionary<object, object> properties = null);

        /// <summary>
        /// Writes the diagnostic message and exception at the Error level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="ex">Exception to Log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void ErrorException(string message, Exception ex, IDictionary<object, object> properties = null);

        /// <summary>
        /// Writes the diagnostic message at the Fatal level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void Fatal(string message, IDictionary<object, object> properties = null);

        /// <summary>
        /// Writes the diagnostic message and exception at the Fatal level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="ex">Exception to Log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void FatalException(string message, Exception ex, IDictionary<object, object> properties = null);
        
        /// <summary>
        /// Gets the Log file path that underlying logger uses. 
        /// Useful for testing purposes.
        /// Works only if target is File.
        /// </summary>
        /// <param name="fileTargetName"></param>
        /// <returns></returns>
        string GetLogFilePath(string fileTargetName);

        /// <summary>
        /// Writes the diagnostic message at the Info level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void Info(string message, IDictionary<object, object> properties = null);

        /// <summary>
        /// Writes the diagnostic message and exception at the Info level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="ex">Exception to Log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void InfoException(string message, Exception ex, IDictionary<object, object> properties = null);

        /// <summary>
        /// Writes the diagnostic message at the Trace level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void Trace(string message, IDictionary<object, object> properties = null);

        /// <summary>
        /// Writes the diagnostic message and exception at the Trace level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="ex">Exception to Log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void TraceException(string message, Exception ex, IDictionary<object, object> properties = null);

        /// <summary>
        /// Writes the diagnostic message at the Warn level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void Warn(string message, IDictionary<object, object> properties = null);

        /// <summary>
        /// Writes the diagnostic message and exception at the Warn level.
        /// </summary>
        /// <param name="message">Message to log</param>
        /// <param name="ex">Exception to Log</param>
        /// <param name="properties">Custom properties and its values that can be used in Layout Rendeeres in the format - <i>$(event-context:item=key)</i></param>
        void WarnException(string message, Exception ex, IDictionary<object, object> properties = null);

        bool IsDebugEnabled { get; }
        bool IsErrorEnabled { get; }
        bool IsFatalEnabled { get; }
        bool IsInfoEnabled { get; }
        bool IsTraceEnabled { get; }
        bool IsWarnEnabled { get; }
    }
}
